package com.czf.testmodule.time.springtask.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

/**
 * @author zfChen
 * @create 2022/6/7 11:30
 */
@Configuration
@EnableScheduling
public class SpringTaskConfig implements SchedulingConfigurer {
    @Override
    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
//        ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
//        threadPoolTaskScheduler.setPoolSize(4);
//        threadPoolTaskScheduler.setThreadNamePrefix("springTask-pool-");
//        threadPoolTaskScheduler.initialize();
//        taskRegistrar.setTaskScheduler(threadPoolTaskScheduler);
    }
}
